home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / include / Qt / qlabel.h.z / qlabel.h
Encoding:
C/C++ Source or Header  |  1998-10-28  |  2.4 KB  |  92 lines

  1. /**********************************************************************
  2. ** $Id: qlabel.h,v 2.8 1998/07/03 00:09:48 hanord Exp $
  3. **
  4. ** Definition of QLabel widget class
  5. **
  6. ** Created : 941215
  7. **
  8. ** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
  9. **
  10. ** This file is part of Qt Free Edition, version 1.40.
  11. **
  12. ** See the file LICENSE included in the distribution for the usage
  13. ** and distribution terms, or http://www.troll.no/free-license.html.
  14. **
  15. ** IMPORTANT NOTE: You may NOT copy this file or any part of it into
  16. ** your own programs or libraries.
  17. **
  18. ** Please see http://www.troll.no/pricing.html for information about 
  19. ** Qt Professional Edition, which is this same library but with a
  20. ** license which allows creation of commercial/proprietary software.
  21. **
  22. *****************************************************************************/
  23.  
  24. #ifndef QLABEL_H
  25. #define QLABEL_H
  26.  
  27. #ifndef QT_H
  28. #include "qframe.h"
  29. #endif // QT_H
  30.  
  31.  
  32. class QLabel : public QFrame
  33. {
  34.     Q_OBJECT
  35. public:
  36.     QLabel( QWidget *parent=0, const char *name=0, WFlags f=0 );
  37.     QLabel( const char *text, QWidget *parent=0, const char *name=0,
  38.         WFlags f=0 );
  39.     QLabel( QWidget * buddy, const char * text,
  40.         QWidget * parent, const char * name=0, WFlags f=0 );
  41.    ~QLabel();
  42.  
  43.     const char *text()        const    { return ltext; }
  44.     QPixmap    *pixmap()    const    { return lpixmap; }
  45.     QMovie     *movie()        const;
  46.  
  47.     int        alignment()    const    { return align; }
  48.     void    setAlignment( int );
  49.     int        margin()    const    { return extraMargin; }
  50.     void    setMargin( int );
  51.  
  52.     bool    autoResize()    const    { return autoresize; }
  53.     void    setAutoResize( bool );
  54.     QSize    sizeHint() const;
  55.  
  56.     void    setBuddy( QWidget * );
  57.     QWidget    *buddy() const;
  58.  
  59. public slots:
  60.     void    setText( const char * );
  61.     void    setPixmap( const QPixmap & );
  62.     void    setMovie( const QMovie & );
  63.     void    setNum( int );
  64.     void    setNum( double );
  65.     void    clear();
  66.  
  67. protected:
  68.     void    drawContents( QPainter * );
  69.  
  70. private slots:
  71.     void    acceleratorSlot();
  72.     void    buddyDied();
  73.     void    movieUpdated(const QRect&);
  74.     void    movieResized(const QSize&);
  75.  
  76. private:
  77.     void    updateLabel();
  78.     QString    ltext;
  79.     QPixmap    *lpixmap;
  80.     int        extraMargin;
  81.     int        align;
  82.     bool    autoresize;
  83.     void    unsetMovie();
  84.  
  85. private:    // Disabled copy constructor and operator=
  86.     QLabel( const QLabel & );
  87.     QLabel &operator=( const QLabel & );
  88. };
  89.  
  90.  
  91. #endif // QLABEL_H
  92.